﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="~/css/aui.css" />
    <style type="text/css">
        .header {
            padding: 2.5rem 0.5rem 2rem 0.5rem;
        }
    </style>
</head>
<head>

</head>
<body class="hold-transition login-page">
    <br />
    <header class="aui-bar aui-bar-nav aui-text-left header" id="header">
        <h1> <a class="aui-btn aui-pull-right" tapmode="tapmode" onClick="openClub()"> <em class="aui-iconfont aui-icon-question"></em> </a> 注册 </h1>
    </header>
    <h2>@ViewData["Title"]</h2>
    @using (Html.BeginForm("register", "Home", FormMethod.Post))
    {
        <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
        <!-- /.login-logo -->
        <div asp-validation-summary="All" class="text-danger"></div>
        <form asp-controller="Login" asp-action="Index" method="post">
            <div class="aui-content aui-margin-b-15">
                <ul class="aui-list aui-form-list">
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                <i class="aui-iconfont aui-icon-my"></i> 帐号
                            </div>
                            <div class="aui-list-item-input">
                                <input type="text" autocomplete="off" name="uname" placeholder="请告诉我你的帐号吧" pattern="^[a-zA-Z0-9_]{5,16}$" required oninvalid="setCustomValidity('请输入正确的用户名,至少5位哦');" oninput="setCustomValidity('');">
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                <i class="aui-iconfont aui-icon-lock"></i>
                                密码
                            </div>
                            <div class="aui-list-item-input">
                                <input onKeyUp="validate()" id="userpwd" type="password" autocomplete="off" name="userpwd" class="form-control" placeholder="密码长至少6位，只限数字字母" pattern="^[a-zA-Z0-9_]{6,16}$" required oninvalid="setCustomValidity('密码至少需要六位');" oninput="setCustomValidity('');">
                    </li>

                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                <div class="aui-col-xs-3">
                                    <i class="aui-iconfont aui-icon-more"></i>
                                    确认密码
                                </div>
                                <div class="aui-list-item-input"></div>
                            </div>
                            <input onKeyUp="validate()" id="userpwd2" type="password" autocomplete="off" name="userpwd" class="form-control" placeholder="再次输入密码" pattern="^[a-zA-Z0-9_]{6,16}$" required oninvalid="setCustomValidity('密码至少需要六位');" oninput="setCustomValidity('');">
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                <i class="aui-iconfont aui-icon-comment"></i> 留言
                            </div>
                            <div class="aui-list-item-input">
                                <input type="text" autocomplete="off" name="message" placeholder="给管理员的留言">
                            </div>
                        </div>
                    </li>
                </ul>

                <div id="tishi">

                </div>
            </div>


            <div class="row">
                <div class="col-xs-4">
                    <p><button id="submit" type="submit" class="aui-btn aui-btn-info aui-btn-block">立即注册</button></p>
                </div>
            </div>
        </form>

        <div id="register_pc_direct_login" class="register-hidden-gruop text-right">
            <a href="/home/login">
                <i class="aui-iconfont aui-icon-paper"></i>返回登录界面&gt;
            </a>
        </div>
    }

</body>
</html>
<script>
    function validate() {
        document.getElementById("submit").disabled = false;
        var pw1 = document.getElementById("userpwd").value;
        var pw2 = document.getElementById("userpwd2").value;
        if (pw1 == pw2) {
            document.getElementById("tishi").innerHTML = "<font color='green'>两次密码相同</font>";
            document.getElementById("submit").disabled = false;
        }
        else {
            document.getElementById("tishi").innerHTML = "<font color='red'>两次密码不相同</font>";
            document.getElementById("submit").disabled = true;
        }
    }
</script>








